package com.cg.controller;

import com.cg.client.AppClient;
import com.cg.dto.Result;
import com.cg.entity.Info;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName InfoController
 * @Description TODO
 * @Author CG
 * @Date 2024/1/7 15:24
 **/
@RestController
@RequestMapping("/info")
public class InfoController {

    @Resource
    private AppClient appClient;

    /**
     * 授权
     */
    @PostMapping("/addInfo")
    public Result addInfo(String cardNum){
        return appClient.addInfo(cardNum);
    }


    /**
     * 查询全部授权信息
     */
    @GetMapping("/queryInfoList")
    public Result<List<Info>> queryInfoList(){
        return appClient.queryInfoList();
    }

    /**
     * 根据授权名称查询授权信息
     */
    @GetMapping("/queryInfo")
    public Result<Info> queryInfo(String infoName){
        return appClient.queryInfo(infoName);
    }
}
